/*
 * @Author: Jone XIn
 * @Date: 2022-02-07 23:18:52
 * @LastEditTime: 2022-02-07 23:29:02
 * @Description: 中间件鉴权_test
 */
import { paramsErrNews } from '../utils/resMessage';

export default class HandleAuth {

    public static checkedToken(req, res, next) {
        const { token } = req.headers;
        if (!token && HandleAuth.validedUser(token)) return res.json(paramsErrNews([], '用户不合法!'));
        next();
    }

    // checked token is illeagle
    private static validedUser(token) {
        console.log(token);
        return true;
    }
}